cmake_minimum_required(VERSION 3.5)
project(example_david)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

SET(CMAKE_BUILD_TYPE "RELEASE")
SET(CMAKE_CXX_FLAGS "-O2 -g ${CMAKE_CXX_FLAGS}")

find_package(ament_cmake_auto REQUIRED)
find_package(OpenCV REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(PCL REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(pcl_conversions REQUIRED)

ament_auto_find_build_dependencies()

include_directories(
  include
  ${OpenCV_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
)


############### listener node ###############

# ament_auto_add_library(${PROJECT_NAME}_listener_node SHARED
#   include/listener.hpp
#   src/listener.cpp
# )

# target_link_libraries(${PROJECT_NAME}_listener_node ${OpenCV_LIBRARIES} ${PCL_LIBRARIES} ${cv_bridge_LIBRARIES})

# rclcpp_components_register_node(${PROJECT_NAME}_listener_node
#   PLUGIN "mars_rover::listener::ListenerNode"
#   EXECUTABLE ${PROJECT_NAME}_listener_exe
# )

############### talker node ###############

ament_auto_add_library(${PROJECT_NAME}_talker_node SHARED
  include/talker.hpp
  src/talker.cpp
)

target_link_libraries(${PROJECT_NAME}_talker_node  ${OpenCV_LIBRARIES} ${PCL_LIBRARIES} ${cv_bridge_LIBRARIES})


rclcpp_components_register_node(${PROJECT_NAME}_talker_node
  PLUGIN "mars_rover::talker::TalkerNode"
  EXECUTABLE ${PROJECT_NAME}_talker_exe
)

# INSTALL
ament_auto_package(INSTALL_TO_SHARE launch param)